package com.java;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.service.Manager;

public class ManagerController {

	public int managerlogin(Manager a) {
		DataConnection d=new DataConnection();
		Connection con=d.getConnection();
		String sql="select * from manager where username=? and password=md5(?)";
		PreparedStatement pst=null;
		int aa=0;
		try {
			pst=con.prepareStatement(sql);
			pst.setString(1, a.getName());
			pst.setString(2, a.getPassword());
			
			aa=pst.executeUpdate();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return aa;
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
